package com.whfc.base.dto;

import com.google.common.base.Objects;

import java.io.Serializable;

/**
 * @Description: 同步缓存key
 * @author: xugcheng
 * @version: 1.0
 * @date: 2021-11-11 11:01
 */
public class SyncCacheKey implements Serializable {

    /**
     * 项目ID
     */
    private Integer deptId;

    /**
     * 平台
     */
    private Integer platform;

    /**
     * 模块
     */
    private String module;

    public SyncCacheKey(Integer deptId, Integer platform, String module) {
        this.deptId = deptId;
        this.platform = platform;
        this.module = module;
    }

    public SyncCacheKey(Integer deptId, Integer platform) {
        this.deptId = deptId;
        this.platform = platform;
    }

    public Integer getDeptId() {
        return deptId;
    }

    public void setDeptId(Integer deptId) {
        this.deptId = deptId;
    }

    public Integer getPlatform() {
        return platform;
    }

    public void setPlatform(Integer platform) {
        this.platform = platform;
    }

    public String getModule() {
        return module;
    }

    public void setModule(String module) {
        this.module = module;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        SyncCacheKey key = (SyncCacheKey) o;
        return Objects.equal(deptId, key.deptId) &&
                Objects.equal(platform, key.platform) &&
                Objects.equal(module, key.module);
    }

    @Override
    public int hashCode() {
        return Objects.hashCode(deptId, platform, module);
    }
}
